package com.ls.dao.sysUser;

import com.ls.pojo.SysUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysUserMapper {
    /**
     * 增加用户信息
     * @param user
     * @return
     */
    public int add(SysUser user) throws Exception;

    /**
     * 用户登录
     * @param account
     * @return
     * @throws Exception
     */
    public SysUser selectByAccount(String account) throws Exception;

    /**
     * 根据条件查询用户列表
     * @param queryRealName
     * @param queryRoleId
     * @return
     */
    public List<SysUser> selectList(@Param("realName") String queryRealName, @Param("roleId") Integer queryRoleId, @Param("pageBegin") Integer currentPageNo, @Param("pageSize") Integer pageSize) throws Exception;

    /**
     * 根据条件查询用户表记录数
     * @param realName
     * @param roleId
     * @return
     */
    public int selectCount(@Param("realName") String realName, @Param("roleId") Integer roleId) throws Exception;

    /**
     * 根据ID查找user
     * @param id
     * @return
     */
    public SysUser selectById(Integer id) throws Exception;

    /**
     * 修改用户信息
     * @param user
     * @return
     */
    public int update(SysUser user) throws Exception;

    /**
     * 根据userId修改密码
     * @param id
     * @param pwd
     * @return
     */
    public int updatePwd(@Param("id") Integer id, @Param("password") String pwd) throws Exception;

    /**
     * 删除用户
     * @param id
     * @return
     */
    public int deleteById(Integer id) throws Exception;
}